/// 反馈列表
class FeedbackResponse {
  List<FeedbackItemResponse> rows;
  int total;

  FeedbackResponse({
    required this.rows,
    required this.total,
  });

  factory FeedbackResponse.fromJson(Map<String, dynamic> json) =>
      FeedbackResponse(
        total: json['total'] as int,
        rows: (json['rows'] as List)
            .map((e) => FeedbackItemResponse.fromJson(e))
            .toList(),
      );
}

class FeedbackItemResponse {
  int? id;
  String? feedbackContent;
  String? image;
  List<String>? images;
  String? replyContent;
  String? replyTime;
  String? createTime;

  FeedbackItemResponse({
    this.id,
    this.feedbackContent,
    this.image,
    this.images,
    this.replyContent,
    this.replyTime,
    this.createTime,
  });

  factory FeedbackItemResponse.fromJson(Map<String, dynamic> json) {
    return FeedbackItemResponse(
      id: json['id'] as int?,
      feedbackContent: json['feedbackContent'] as String?,
      image: json['image'] as String?,
      images: (json['image'] as String?)
          ?.split(',')
          .where((i) => i.isNotEmpty)
          .toList(),
      replyContent: json['replyContent'] as String?,
      replyTime: json['replyTime'] as String?,
      createTime: json['createTime'] as String?,
    );
  }

  Map<String, dynamic> toJson() => {
        'id': id,
        'feedbackContent': feedbackContent,
        'image': image,
        'images': images,
        'replyContent': replyContent,
        'replyTime': replyTime,
        'createTime': createTime,
      };
}
